package com.ecoolex.union.pay.retailer.core.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

import com.ecoolex.framework.modularize.api.auth.admin.AdminMemberAuthorityManager;
import com.ecoolex.framework.modularize.api.auth.platform.PlatformMemberAuthorityManager;
import com.ecoolex.framework.modularize.api.auth.user.ConsumerMemberAuthorityManager;
import com.ecoolex.framework.modularize.api.service.config.SystemConfig;
import com.ecoolex.union.pay.retailer.core.CoreConstant;


@Profile(CoreConstant.PROJECT_CORE_NAME)
@Configuration
public class UnionPayRetailerCoreInitializer{

	/**
	 * 系统配置注册
	 * 
	 * @param config
	 */
	@Autowired
	public void registerSystemConfig(SystemConfig config) {
		// config.register(Constant.CONFIG_ENABLE_USER_REGISTER, "true", "启用用户注册页面", Constant.PROJECT_CORE_NAME);
//		config.register(CoreConstant.CONFIG_UNION_PAY_RETAILER_ORDER_AUTO_CANCEL_MINUTES,
//			"30",
//			"银联国际商城系统订单自动取消时间(分钟)",
//			CoreConstant.PROJECT_CORE_NAME);
//		config.register(CoreConstant.CONFIG_UNION_PAY_RETAILER_ORDER_AUTO_CONFIRM_RECEIVED_DAY,
//			"10",
//			"银联国际商城系统订单自动确认收货(天)",
//			CoreConstant.PROJECT_CORE_NAME);
	}

	/**
	 * 权限注册
	 * 
	 * @param userAuthManager     用户权限管理
	 * @param adminAuthManager    后台权限管理
	 * @param platformAuthManager 平台权限管理
	 */
	@Autowired
	public void registerAuthority(ConsumerMemberAuthorityManager userAuthManager, AdminMemberAuthorityManager adminAuthManager, PlatformMemberAuthorityManager platformAuthManager) {
		// AuthorityRegister register = new AuthorityRegister();
		// register.setKey(Constant.AUTH_MODULE_KEY);
		// register.setName(Constant.AUTH_MODULE_NAME);
		// register.setRemark(Constant.AUTH_MODULE_REMARK);
		//
		// userAuthManager.register(register);
		// adminAuthManager.register(register);
		// platformAuthManager.register(register);
	}
}
